package com.flying.admin.service;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.data.Data;
import com.flying.framework.service.AbstractService;

@Service(value="ServiceInterface", desc="服务接口")
public class ServiceInterface extends AbstractService{
	public final static String TABLE_NAME = "sys_service_interface";
	
	public enum Field {
		
		interface_id   ("interface_id",      "int",	"接口ID"),
		group_id       ("group_id",          "int",	"分组ID"),
		module_id      ("module_id",         "String",	"模块ID"),
		service_id     ("service_id",        "String",	"服务ID"),
		service_method ("service_method",    "String",	"服务方法"),
		service_level  ("service_level",     "int",	"约定接口的响应时间"),
		remark         ("remark",            "String",	"服务描述");
		
		public final String fieldName;
		public final String fieldType;
		public final String fieldComment;
	
		Field(String name, String dataType, String comment) {
			this.fieldName 		= name;
			this.fieldType		= dataType;
			this.fieldComment	= comment;
		}
	}
        
	@MethodInfo("创建服务接口")
	@DaoCreate(entity="sys_service_interface")
	public Data create(
		
			@Param(value="interface_id",      required=true,	desc="接口ID") int interface_id,
			@Param(value="group_id",          required=false,	desc="分组ID") int group_id,
			@Param(value="module_id",         required=false,	desc="模块ID") String module_id,
			@Param(value="service_id",        required=false,	desc="服务ID") String service_id,
			@Param(value="service_method",    required=false,	desc="服务方法") String service_method,
			@Param(value="service_level",     required=false,	desc="约定接口的响应时间") int service_level,
			@Param(value="remark",            required=false,	desc="服务描述") String remark
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("修改服务接口")
	@DaoUpdate(entity="sys_service_interface")
	public Data update(
		
			@Param(value="interface_id",      required=false,	desc="接口ID") int interface_id,
			@Param(value="group_id",          required=false,	desc="分组ID") int group_id,
			@Param(value="module_id",         required=false,	desc="模块ID") String module_id,
			@Param(value="service_id",        required=false,	desc="服务ID") String service_id,
			@Param(value="service_method",    required=false,	desc="服务方法") String service_method,
			@Param(value="service_level",     required=false,	desc="约定接口的响应时间") int service_level,
			@Param(value="remark",            required=false,	desc="服务描述") String remark,
			@Param(value="fields", required=false, desc="更新字段", tag="fields") String[] fields
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除服务接口")
	@DaoRemove(entity="sys_service_interface")
	public Data remove(
		
			@Param(value="interface_id",      required=true,	desc="接口ID") int interface_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("查询所有服务接口")
	@DaoQuery(entity="sys_service_interface")
	public Data findAll() throws Exception {
		return null;
	}

	@MethodInfo("根据主键查询服务接口")
	@DaoQuery(entity="sys_service_interface", single=true)
	public Data findById(
		
			@Param(value="interface_id",      required=true,	desc="接口ID") int interface_id
		
		) throws Exception {
		return null;
	}

}